<tagLib name="cx,html" />
<script language="javascript">
ROOT = '__ROOT__';
</script>
<html:link type="CSS" href="__PUBLIC__/Js/thickbox/thickbox.css" />
<html:link type="JS" href="../Public/Js/common.js" />
<html:link type="JS" href="__PUBLIC__/Js/thickbox/thickbox-compressed.js" />

<div id="box">
<h3>友情链接</h3>
<form id="linkListForm" method="post" action="{:url('del')}">
<table id="linkList" class="list" cellpadding="0" cellspacing="0" >
<thead>
<tr>
	<th width="8"><input type="checkbox" class="checkbox" id="check" onclick="CheckAll('linkList')" /></th>
	<th>友链名称</th><th>友链描述</th><th>URL</th><th width="55x">目标窗口</th><th width="30px">排序</th><th width="60px">操作</th>
</tr>
</thead>
<tbody>
<volist name="linkList" id="link">
<tr>
	<td><input type="checkbox" class="checkbox" name="link_id[]" value="{$link.link_id}" /></td>
	<td>{$link.link_name|Input::forShow}</td>
	<td>{$link.link_description|Input::forShow}</td>
	<td>{$link.link_url|Input::forShow}</td>
	<td>{$link.link_target|parseTarget|Input::forShow}</td>
	<td>{$link.link_rating|Input::forShow}</td>
	<td><a href="{:url('del',MODULE_NAME,'',APP_NAME,array('link_id'=>$link['link_id']))}" onclick="return confirm('确认删除吗？');">删除</a>&nbsp;<a href="javascript:void(0)" onclick="$('#link_id').attr('value','{$link.link_id}');$('#link_name').attr('value','{$link.link_name|Input::forTag}');$('#link_description').attr('value','{$link.link_description|Input::forTag}');$('#link_url').attr('value','{$link.link_url|Input::forTag}');$('#link_target').attr('value','{$link.link_target}');$('#link_rating').attr('value','{$link.link_rating|Input::forTag}');tb_show('编辑友情链接','#TB_inline?height=220&width=250&inlineId=linkDiv','thickbox');">编辑</a></td>
</tr>
</volist>
</tbody>
</table>
<p><input type="button" value="添加友情链接" class="btn" onclick="tb_show('添加友情链接','#TB_inline?height=220&width=250&inlineId=linkDiv','thickbox');" /> <input type="button" value="删除所选" class="btn" onclick="if(confirm('真的要删除这些链接吗？')) $('#linkListForm').submit(); else return false;" /></p>
</form>

<!--编辑/添加分类-->
<div id="linkDiv" style="display:none">
<form id="linkForm" method="POST" action="{:url('edit')}">
<p>友链名称&nbsp;<input type="text" id="link_name" name="link_name" class="txt" /></p>
<p>友链描述&nbsp;<input type="text" id="link_description" name="link_description" class="txt" /></p>
<p>　　URL&nbsp;<input type="text" id="link_url" name="link_url" class="txt" /></p>
<p>目标窗口&nbsp;<select name="link_target" id="link_target"><option value="_blank">新窗口</option><option value="_self">本窗口</option></select></p>
<p>　　排序&nbsp;<input type="text" id="link_rating" name="link_rating" style="width: 40px;" class="txt" /> 数值小的排前面</p>
<p align="center"><input type="submit" class="btn" value="确定" /></p><input type="hidden" name="link_id" id="link_id" />
</form>
</div>
</div>